package com.ita.acmsystem.merchant.servlet.mock;

import java.io.IOException;
import java.util.UUID;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ita.acmsystem.merchant.entity.Foods;

/**
 * Servlet implementation class AddServletMock
 */
public class AddServletMock extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AddServletMock() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	private void addFood(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String foodId = UUID.randomUUID().toString();
		String foodName = request.getParameter("foodName");
		String foodPrice = request.getParameter("foodPrice");
		String foodPicture = request.getParameter("foodPic");
		String foodTypeId = request.getParameter("foodFoodType");
		String merchantId = UUID.randomUUID().toString();
		
		Foods food = new Foods(foodId, foodName, foodPrice, foodPicture, foodTypeId, merchantId);
		System.out.println(food);
	}
}
